$(function(){
$('input').bind('change',function(){
	$("div").children('font').remove();;
})  
}) 

function product_name_select() {
//	$("#timeDiv").children('font').remove();
	$.ajax({
		url : '/zmkm_oa/product_use_register/product_name_select',
		dataType : 'html',
		data : ({}),
		success : function(data) {
			var re = eval('(' + data + ')');
			$("#product_name").html(re.msg)
		}
	})
}

function product_model_select() {
	var productName = $("#product_name").val();
	$.ajax({
		url : '/zmkm_oa/product_use_register/product_model_select',
		dataType : 'html',
		data : ({
			'productName' : productName
		}),
		success : function(data) {
			var re = eval('(' + data + ')');
			$("#product_model").html(re.msg)
		}
	})
	
}

function wristband_name_select() {
	$.ajax({
		url : '/zmkm_oa/product_use_register/wristband_name_select',
		dataType : 'html',
		data : ({}),
		success : function(data) {
			var re = eval('(' + data + ')');
			$("#wristband_name").html(re.msg)
		}
	})
}
	
function wristband_model_select() {
		var wristbandName = $("#wristband_name").val();
		$.ajax({
			url : '/zmkm_oa/product_use_register/product_model_select',
			dataType : 'html',
			data : ({
				'productName' : wristbandName
			}),
			success : function(data) {
				var re = eval('(' + data + ')');
				$("#wristband_model").html(re.msg)
			}
		})
}
function registerVerify(){
	if($("#time").val() == null || $("#time").val() == ""){
		$("#timeDiv").children('font').remove();
		$("#timeDiv").append("<font color='red'>安装时间不能为空</font>");
		$("#time").focus();
	}else if($("#product_name").val()==null || $("#product_name").val() == ""){
		$("#product_nameDiv").children('font').remove();
		$("#product_nameDiv").append("<font color='red'>产品名不能为空</font>");
		$("#product_name").focus();
	}else if($("#product_model").val()==null || $("#product_model").val() == ""){
		$("#product_modelDiv").children('font').remove();
		$("#product_modelDiv").append("<font color='red'>产品型号不能为空</font>");
		$("#product_model").focus();
	}else if($("#wristband_name").val()==null || $("#wristband_name").val() == ""){
		$("wristband_nameDiv").children('font').remove();
		$("#wristband_nameDiv").append("<font color='red'>手环名不能为空</font>");
		$("#wristband_name").focus();
	}else if($("#wristband_model").val()==null || $("#wristband_model").val() == ""){
		$("#wristband_modelDiv").children('font').remove();
		$("#wristband_modelDiv").append("<font color='red'>手环型号不能为空</font>");
		$("#wristband_model").focus();
	}else if($("#wristband_number").val()==null || $("#wristband_number").val() == ""){
		$("#wristband_numberDiv").children('font').remove();
		$("#wristband_numberDiv").append("<font color='red'>手环数不能为空</font>");
		$("#wristband_number").focus();
	}else if($("#client_name").val()==null || $("#client_name").val() == ""){
		$("#client_nameDiv").children('font').remove();
		$("#client_nameDiv").append("<font color='red'>客户名不能为空</font>");
		$("#client_name").focus();
	}else if($("#client_phone").val()==null || $("#client_phone").val() == ""){
		$("client_phoneDiv").children('font').remove();
		$("#client_phoneDiv").append("<font color='red'>客户手机不能为空</font>");
		$("#client_phone").focus();
	}else if($("#uptown_name").val()==null || $("#uptown_name").val() == ""){
		$("#uptown_nameDiv").children('font').remove();
		$("#uptown_nameDiv").append("<font color='red'>小区名不能为空</font>");
		$("#uptown_name").focus();
	}else if($("#client_address").val()==null || $("#client_address").val() == ""){
		$("#client_addressDiv").children('font').remove();
		$("#client_addressDiv").append("<font color='red'>门牌不能为空</font>");
		$("#client_address").focus();
	}else if($("#Vip_number").val()==null || $("#Vip_number").val() == ""){
		$("#Vip_numberDiv").children('font').remove();
		$("#Vip_numberDiv").append("<font color='red'>会员关联号不能为空</font>");
		$("#Vip_number").focus();
	}else if($("#install_man").val()==null || $("#install_man").val() == ""){
		$("#install_manDiv").children('font').remove();
		$("#install_manDiv").append("<font color='red'>安装人员名称不能为空</font>");
		$("#install_man").focus();
	}else if($("#payment").val()==0){
		$("#paymentDiv").children('font').remove();
		$("#paymentDiv").append("<font color='red'>付款情况不能为空</font>");
		$("#payment").focus();
	}else{
		$("#formPUR").submit();
	}
  }
